<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:sec="http://www.springframework.org/security/facelets/tags">

<h:head>
    <title>Avaliação InfNet</title>
    <meta http-equiv="content-type" content="text/xhtml; charset=UTF-8" />
</h:head>

<body >
	<p:panel style="width: 700px;margin: auto;" header="Avaliação InfNet"
		footer="Sistema de Avaliação InfNet - 2013" >
		
		<h:form>
			<p:menubar>
				<p:submenu label="Cadastro" icon="ui-icon ui-icon-document" rendered="#{sec:ifAnyGranted('ROLE_ADMIN,ROLE_USER')}"  >
					<p:menuitem value="Usuário" outcome="/private/cadastroUsuario.xhtml" rendered="#{sec:ifAnyGranted('ROLE_ADMIN')}" /> 
					<p:menuitem value="Avaliação" outcome="/private/avaliacao.xhtml" rendered="#{sec:ifAnyGranted('ROLE_ADMIN')}" /> 
					<p:menuitem value="Permissão" rendered="#{sec:ifAnyGranted('ROLE_ADMIN')}" /> 
				</p:submenu>
				<p:submenu label="Relatório" icon="ui-icon ui-icon-document" rendered="#{sec:ifAnyGranted('ROLE_ADMIN,ROLE_USER')}">
				    <p:menuitem value="Usuário" outcome="/private/listaUsuarios.xhtml" rendered="#{sec:ifAnyGranted('ROLE_ADMIN,ROLS_USER')}" /> 
					<p:menuitem value="Avaliação" outcome="/private/avaliacao.xhtml" rendered="#{sec:ifAnyGranted('ROLE_ADMIN,ROLE_USER')}"/> 
				</p:submenu>
				
			</p:menubar>
			
		   <p:submenu>
			<h5>Você está logado com o usuário: <b><h:outputText value="#{loginBean.usuarioLogado}" /></b></h5>
			</p:submenu>
		</h:form>
		<p:commandButton type="submit"  style="float:right" value="Sair" action="#{loginBean.logout}" />
	</p:panel>

</body>
</html>